home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
PROBLEMS
/
BENCHMARK
/
BUBBLESORT
/
bubbletest
/
func_asm
< prev
next >
Wrap
Text File
|
1992-05-16
|
7KB
|
216 lines
; pipeout of formula (formula is Freeware)
; FUNCTION INT field(INT fieldnr,CHARPTR target,CHARPTR source)
.MACRO field formularesult,fieldnr,target,source
; INT sourcei
; INT targeti
; INT fieldcount
; INT readyflag
; LET readyflag=0;
saveregister
;[stackregister,#28.]=0.
INTconstload R0,0.
INTstackstore [stackregister,#28.],R0
; LET target[0]=0;
;0.
; array [stackregister,#%3] with 1 dimensions
INTconstload R1,0.
INTconstmult R1,1
CHARPTRstackload R2,[stackregister,#%3]
CHARPTR2INT R2,R2
INTsum R1,R1,R2
;R1=0.
INTconstload R0,0.
INT2CHAR R0,R0
CHARarraystore R1,R0
; LET sourcei=0;
;[stackregister,#16.]=0.
INTconstload R0,0.
INTstackstore [stackregister,#16.],R0
; LET targeti=0;
;[stackregister,#20.]=0.
INTconstload R0,0.
INTstackstore [stackregister,#20.],R0
; LET fieldcount=1
;[stackregister,#24.]=1.
INTconstload R0,1.
INTstackstore [stackregister,#24.],R0
; WHILE ! readyflag
\whilelabel1
;![stackregister,#28.]
INTstackload R0,[stackregister,#28.]
INTnot R0,R0
ifnotgoto \endwhilelabel1,R0
; WHILE (source[sourcei]<=32) && (source[sourcei]!=0)
\whilelabel2
;[stackregister,#16.]
; array [stackregister,#%4] with 1 dimensions
INTstackload R1,[stackregister,#16.]
INTconstmult R1,1
CHARPTRstackload R2,[stackregister,#%4]
CHARPTR2INT R2,R2
INTsum R1,R1,R2
CHARarrayload R1,R1
;R1<=32.
INTconstload R0,32.
CHAR2INT R1,R1
INTlessequal R1,R1,R0
;[stackregister,#16.]
; array [stackregister,#%4] with 1 dimensions
INTstackload R2,[stackregister,#16.]
INTconstmult R2,1
CHARPTRstackload R3,[stackregister,#%4]
CHARPTR2INT R3,R3
INTsum R2,R2,R3
CHARarrayload R2,R2
;R2!=0.
INTconstload R0,0.
CHAR2INT R2,R2
INTnotequal R2,R2,R0
;R1&&R2
INTand R1,R1,R2
ifnotgoto \endwhilelabel2,R1
; LET sourcei=sourcei+1;
;[stackregister,#16.]=[stackregister,#16.]+1.
INTstackload R0,[stackregister,#16.]
INTconstload R1,1.
INTsum R0,R0,R1
INTstackstore [stackregister,#16.],R0
; ENDWHILE
goto \whilelabel2
\endwhilelabel2
; IF source[sourcei]==0
;[stackregister,#16.]
; array [stackregister,#%4] with 1 dimensions
INTstackload R1,[stackregister,#16.]
INTconstmult R1,1
CHARPTRstackload R2,[stackregister,#%4]
CHARPTR2INT R2,R2
INTsum R1,R1,R2
CHARarrayload R1,R1
;R1==0.
INTconstload R0,0.
CHAR2INT R1,R1
INTequal R1,R1,R0
ifnotgoto \elselabel3,R1
; LET readyflag=1;
;[stackregister,#28.]=1.
INTconstload R0,1.
INTstackstore [stackregister,#28.],R0
; ELSE
goto \endiflabel3
\elselabel3
; WHILE (source[sourcei]!=32) && (source[sourcei]!=0)
\whilelabel4
;[stackregister,#16.]
; array [stackregister,#%4] with 1 dimensions
INTstackload R1,[stackregister,#16.]
INTconstmult R1,1
CHARPTRstackload R2,[stackregister,#%4]
CHARPTR2INT R2,R2
INTsum R1,R1,R2
CHARarrayload R1,R1
;R1!=32.
INTconstload R0,32.
CHAR2INT R1,R1
INTnotequal R1,R1,R0
;[stackregister,#16.]
; array [stackregister,#%4] with 1 dimensions
INTstackload R2,[stackregister,#16.]
INTconstmult R2,1
CHARPTRstackload R3,[stackregister,#%4]
CHARPTR2INT R3,R3
INTsum R2,R2,R3
CHARarrayload R2,R2
;R2!=0.
INTconstload R0,0.
CHAR2INT R2,R2
INTnotequal R2,R2,R0
;R1&&R2
INTand R1,R1,R2
ifnotgoto \endwhilelabel4,R1
; IF fieldcount==fieldnr
;[stackregister,#24.]==[stackregister,#%2]
INTstackload R0,[stackregister,#24.]
INTstackload R1,[stackregister,#%2]
INTequal R0,R0,R1
ifnotgoto \elselabel5,R0
; LET readyflag=1;
;[stackregister,#28.]=1.
INTconstload R0,1.
INTstackstore [stackregister,#28.],R0
; LET target[targeti]=source[sourcei];
;[stackregister,#20.]
; array [stackregister,#%3] with 1 dimensions
INTstackload R1,[stackregister,#20.]
INTconstmult R1,1
CHARPTRstackload R2,[stackregister,#%3]
CHARPTR2INT R2,R2
INTsum R1,R1,R2
;[stackregister,#16.]
; array [stackregister,#%4] with 1 dimensions
INTstackload R2,[stackregister,#16.]
INTconstmult R2,1
CHARPTRstackload R3,[stackregister,#%4]
CHARPTR2INT R3,R3
INTsum R2,R2,R3
CHARarrayload R2,R2
;R1=R2
CHARarraystore R1,R2
; LET targeti=targeti+1;
;[stackregister,#20.]=[stackregister,#20.]+1.
INTstackload R0,[stackregister,#20.]
INTconstload R1,1.
INTsum R0,R0,R1
INTstackstore [stackregister,#20.],R0
; ENDIF
\elselabel5
; LET sourcei=sourcei+1
;[stackregister,#16.]=[stackregister,#16.]+1.
INTstackload R0,[stackregister,#16.]
INTconstload R1,1.
INTsum R0,R0,R1
INTstackstore [stackregister,#16.],R0
; ENDWHILE
goto \whilelabel4
\endwhilelabel4
; IF readyflag
;[stackregister,#28.]
INTstackload R0,[stackregister,#28.]
ifnotgoto \elselabel6,R0
; LET target[targeti]=0
;[stackregister,#20.]
; array [stackregister,#%3] with 1 dimensions
INTstackload R1,[stackregister,#20.]
INTconstmult R1,1
CHARPTRstackload R2,[stackregister,#%3]
CHARPTR2INT R2,R2
INTsum R1,R1,R2
;R1=0.
INTconstload R0,0.
INT2CHAR R0,R0
CHARarraystore R1,R0
; ELSE
goto \endiflabel6
\elselabel6
; LET fieldcount=fieldcount+1
;[stackregister,#24.]=[stackregister,#24.]+1.
INTstackload R0,[stackregister,#24.]
INTconstload R1,1.
INTsum R0,R0,R1
INTstackstore [stackregister,#24.],R0
; ENDIF
\endiflabel6
; ENDIF
\endiflabel3
; ENDWHILE
goto \whilelabel1
\endwhilelabel1
; ENDFUNCTION
\formulafunctionend
.ENDM
; end of inputfile: <bubbletest$dir>.provefunc